package service

import (
	"gitee.com/Luna-CY/Golang-Project-Template/internal/errors"
	"gitee.com/Luna-CY/Golang-Project-Template/internal/util/pointer"
	"gitee.com/Luna-CY/Golang-Project-Template/model"
)

type SystemSmsLogField field[model.SystemSmsLog]

func SystemSmsLogFieldWithStatus(status model.SystemSmsLogStatus) SystemSmsLogField {
	return func(log *model.SystemSmsLog) errors.Error {
		log.Status = pointer.New(status)

		return nil
	}
}

func SystemSmsLogFieldWithFailedReason(failedReason string) SystemSmsLogField {
	return func(log *model.SystemSmsLog) errors.Error {
		log.FailedReason = pointer.New(failedReason)

		return nil
	}
}

func SystemSmsLogFieldWithCompleteTime(completeTime int64) SystemSmsLogField {
	return func(log *model.SystemSmsLog) errors.Error {
		log.CompleteTime = pointer.New(completeTime)

		return nil
	}
}
